

<template>
  <div class="z-dragxml-com z-dragxml-upload z-dragxml-com-auto"
       :class="[zdrag__state_cls()]"
       @mouseenter.stop="zdrag__onMouseEnter"
  >
<!--    {{uuid}}-->
    <z-cell-item v-bind="zdrag__form_config"
                 :label="zdrag__GET_CONFIG('ui.label', '')"
                 :desc="zdrag__GET_CONFIG('ui.desc', '')"
                 :ui="zdrag__GET_CONFIG('ui', {})"
                 :hidden-label="zdrag__GET_CONFIG('ui.hiddenLabel', false)"
    >
      <cus-uploader :ui="zdrag__cus_config.ui"></cus-uploader>
    </z-cell-item>
  </div>
</template>

<script>
import CusUploader from "@/components/CustomForm/CusUploader.vue";
import {createZDragComponentV2} from "@/plugins/z-dragxml/factory";

export default createZDragComponentV2('ZDragUpload',{
  components: {CusUploader},
  data() {
    return {
      ui: {
        label: '附件',
        widgetConfig: {
        }
      }
    }
  }
}, {
  DRAG_FIELD: true,
  DRAG_CONFIG() {
    let obj = CusUploader.CUS_EDITOR() ?? { props: {} }
    Reflect.deleteProperty(obj.props, 'type')
    return obj
  },
  DRAG_LABEL_XML() {
    return `<div class="z-dragxml-row">
<svg t="1637134266814" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2469" width="16" height="16"><path d="M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163c-3.2-4.1-9.4-4.1-12.6 0l-112 141.7c-4.1 5.3-0.4 13 6.3 13z" p-id="2470"></path><path d="M878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" p-id="2471"></path></svg>
<div class="z-dragxml-label__name">附件</div>
</div>`
  },
  DRAG_EXPORT() {
    return {
      ui: {
        widget: 'CusUploader'
      }
    }
  },
})
</script>
